<!DOCTYPE html>
<html>
<head>
    <title>优惠券添加</title>
    <link rel="icon" href="${ctx}/images/favicon.ico">
    <link rel="stylesheet" href="${ctx}/lib/layui-v2.5.5/css/layui.css" media="all">
    <link rel="stylesheet" href="${ctx}/css/layuimini.css" media="all">
    <link rel="stylesheet" href="${ctx}/lib/font-awesome-4.7.0/css/font-awesome.min.css" media="all">
    <link rel="stylesheet" href="${ctx}/css/formSelects-v4.css" media="all">
    <link rel="stylesheet" href="${ctx}/css/public.css" media="all">
    <link rel="stylesheet" href="${ctx}/css/discountcss/layui.css" media="all">
    <script src="${ctx}/js/lay-config.js" charset="utf-8"></script>
    <script type="text/javascript">
        var ctx = "${ctx}";
    </script>
</head>
<body class="childrenBody">
<input id="discountId" type="hidden" value="${(discount.id)!}"/>
<fieldset class="layui-elem-field layui-field-title"
          style="margin-top: 20px;margin: 0 auto;width: 60%;margin-bottom: 20px">
    <legend>优惠券编辑</legend>
</fieldset>

<form class="layui-form" action="" style="margin: 0 auto;width: 60%;padding-bottom: 10px" lay-filter="demo-val-filter">
    <div class="layui-form-item">
        <label class="layui-form-label">优惠券类型</label>
        <div class="layui-input-block">
            <select name="type" lay-filter="aihao">
                <option value=""></option>
                    <option value="0">全场赠券</option>
                    <option value="1">会员赠券</option>
                    <option value="2">购物赠券</option>
                    <option value="3">注册赠券</option>
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">优惠券名称</label>
        <div class="layui-input-block">
            <input type="text" name="name" lay-verify="required" lay-reqtext="优惠券名称岂能为空？"
                   placeholder="请输入" autocomplete="off" class="layui-input" value="">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">适用平台</label>
        <div class="layui-input-block">
            <select name="platform" lay-filter="aihao">
                <option value=""></option>
                <#if discount.platform==0>
                    <option value="0" selected>全部</option>
                    <option value="1">移动</option>
                    <option value="2">PC</option>
                <#elseif discount.platform==1>
                    <option value="0">全部</option>
                    <option value="1" selected>移动</option>
                    <option value="2">PC</option>
                <#elseif discount.platform==2>
                    <option value="0">全部</option>
                    <option value="1">移动</option>
                    <option value="2" selected>PC</option>
                </#if>
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">总发行量</label>
        <div class="layui-input-block">
            <input type="text" name="count" lay-verify="required" lay-reqtext="总发行量为空，那用啥？"
                   placeholder="请输入整数" autocomplete="off" class="layui-input" value="">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">面额</label>
        <div class="layui-input-block">
            <div class="layui-input-group" style="width: 100%">
                <input type="text" placeholder="请输入金额" class="layui-input" lay-verify="required" name="amount" onkeyup="value=value.replace(/[^\d]/g,'')"
                       lay-reqtext="请输入数量" value="">
                <div class="layui-input-split layui-input-suffix">元</div>
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label" >每人限领</label>
        <div class="layui-input-block">
            <div class="layui-input-group" style="width: 100%">
                <input type="text" placeholder="请输入数量" class="layui-input" lay-verify="required" name="perLimit" onkeyup="value=value.replace(/[^\d]/g,'')"
                       lay-reqtext="每人限领都是0，要不别设置优惠券了？" value="">
                <div class="layui-input-split layui-input-suffix">张</div>
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">使用门槛</label>
        <div class="layui-input-block">
            <div class="layui-input-group" style="width: 100%">
                <div class="layui-input-split layui-input-prefix">
                    满
                </div>
                <input type="text" placeholder="请输入金额" class="layui-input" name="minPoint"
                       value="">
                <div class="layui-input-split layui-input-suffix">
                    元可用
                </div>
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">领取日期</label>
            <div class="layui-input-inline layui-input-wrap">
                <div class="layui-input-prefix">
                    <i class="layui-icon layui-icon-date"></i>
                </div>
                <input type="text" name="enableTime" id="enableTime" lay-verify="date" placeholder="年-月-日"
                       autocomplete="off" class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">有效期</label>
            <div class="layui-input-inline layui-input-wrap">
                <div class="layui-input-prefix">
                    <i class="layui-icon layui-icon-date"></i>
                </div>
                <input type="text" name="startTime" id="startTime" lay-verify="date" placeholder="年-月-日"
                       autocomplete="off" class="layui-input" style="float: left">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label" style="text-align: center;">至</label>
            <div class="layui-input-inline layui-input-wrap" style="margin-left: 15px">
                <div class="layui-input-prefix">
                    <i class="layui-icon layui-icon-date"></i>
                </div>
                <input type="text" name="endTime" id="endTime" lay-verify="date" placeholder="年-月-日"
                       autocomplete="off" class="layui-input" style="float: left">
            </div>
        </div>
    </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">可使用商品</label>
        <div class="layui-input-block">
                <input type="radio" name="useType" value="0" title="全场通用">
                <input type="radio" name="useType" value="1" title="指定分类">
                <input type="radio" name="useType" value="2" title="指定商品">
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-input-block">
            <button type="submit" class="layui-btn" lay-submit="" lay-filter="submit_val">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
</form>

<script type="text/javascript" src="${ctx}/js/discount/layui.js"></script>
<script type="text/javascript" src="${ctx}/js/discount/discount_update.js"></script>


</body>
</html>